home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / tpega.zip / WORLD.P < prev   
Text File  |  1986-02-01  |  1KB  |  55 lines

  1. {                                                                             }
  2. {       EGA Graphic Primitive for Turbo Pascal 3.01A, Version 10JAN86.        }
  3. {       (C) 1986 by Kent Cedola, 2015 Meadow Lake Ct., Norfolk, VA, 23518     }
  4. {                                                                             }
  5. {       Description: This an example of how graphic primitives can be put     }
  6. {       together to form 'HIGH LEVEL' graphic routines.                       }
  7. {                                                                             }
  8.  
  9. procedure SetViewport(X1,Y1,X2,Y2: Integer);
  10. begin
  11.   GPVIEWPORT(X1,Y1,X2,Y2);
  12. end;
  13.  
  14. procedure SetWindow(X1,Y1,X2,Y2: Integer);
  15. begin
  16.   GPWINDOW(X1,Y1,X2,Y2);
  17. end;
  18.  
  19. procedure MovAbs(X,Y: Integer);
  20. begin
  21.   GDCURX1 := X;
  22.   GDCURY1 := Y;
  23. end;
  24.  
  25. procedure MovRel(X,Y: Integer);
  26. begin
  27.   GDCURX1 := GDCURX1 + X;
  28.   GDCURY1 := GDCURY1 + Y;
  29. end;
  30.  
  31. procedure LnAbs(X2,Y2: Integer);
  32. var
  33.   X1,Y1:  Integer;
  34.   I: Integer;
  35. begin
  36.   X1 := GDCURX1;
  37.   Y1 := GDCURY1;
  38.   GDCURX1 := X2;
  39.   GDCURY1 := Y2;
  40.  
  41.   if GPCLIP2(X1,Y1,X2,Y2) <> 2 then
  42.     begin
  43.     GPSCALE(X1,Y1);
  44.     GPMOVE(X1,Y1);
  45.     GPSCALE(X2,Y2);
  46.     GPLINE(X2,Y2);
  47.     end;
  48.  
  49. end;
  50.  
  51. procedure LnRel(X,Y: Integer);
  52. begin
  53.   LnAbs(GDCURX1 + X, GDCURY1 + Y);
  54. end;
  55.